/** 
  国际学术会议申请
*/
<template>
    <div class="topic-info" style="width:100%;">
        <div class="project-application-container" style="height: 30px;">
            <el-breadcrumb style="float: left;" separator="/">
                <el-breadcrumb-item :to="{ path: '/AppListOfIntAcaCon' }">
                    <span @click="returnList">国际学术会议基金申请</span>
                </el-breadcrumb-item>
                <el-breadcrumb-item>
                    <span v-if="submitType === 'add'">申请</span>
                    <span v-else-if="submitType === 'edit'">编辑</span>
                    <span v-else-if="submitType === 'view'">查看</span>
                </el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <el-card shadow="never">
            <el-button style="float:right" @click="returnList">返回</el-button>
            <span class="top-title">
                <h3 v-if="submitType === 'add'">国际学术会议基金申请-申请</h3>
                <h3 v-else-if="submitType === 'edit'">国际学术会议基金申请-编辑</h3>
                <h3 v-else-if="submitType === 'view'">国际学术会议基金申请-查看</h3>
            </span>
            <hr />
            <el-form
                :model="infoForm"
                ref="infoForm"
                :rules="basicInfoRules"
                label-position="top"
                label-suffix="："
                :label-width="labelWidth"
            >
                <span class="topic-form-title">
                    <h3>个人信息</h3>
                </span>
                <el-row :gutter="24">
                    <el-col :span="6">
                        <el-form-item label="学院" prop="studentFaculty">
                            <el-input
                                v-model="infoForm.studentFaculty"
                                class="topic-input-select"
                                placeholder="请输入"
                                :disabled="ifAdd"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="学号" prop="studentId">
                            <el-input
                                v-model="infoForm.studentId"
                                class="topic-input-select"
                                placeholder="请输入"
                                :disabled="ifAdd"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="姓名" prop="studentName">
                            <el-input
                                v-model="infoForm.studentName"
                                class="topic-input-select"
                                placeholder="请输入"
                                :disabled="ifAdd"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="学习形式" prop="formLearning">
                            <el-select
                                v-model="infoForm.formLearning"
                                class="topic-input-select"
                                clearable
                                filterable
                                placeholder="请选择"
                                :disabled="ifAdd"
                            >
                                <el-option
                                    v-for="item in source.formLearning"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="24">
                    <el-col :span="6">
                        <el-form-item label="出生年月" prop="birthday">
                            <el-date-picker
                                v-model="infoForm.birthday"
                                type="date"
                                :disabled="ifAdd"
                                class="topic-input-select"
                                value-format="yyyy-MM-dd HH:mm:ss"
                            ></el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="性别" prop="sex">
                            <el-select
                                v-model="infoForm.sex"
                                class="topic-input-select"
                                clearable
                                filterable
                                placeholder="请选择"
                                :disabled="ifAdd"
                            >
                                <el-option
                                    v-for="item in source.sex"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="专业" prop="profession">
                            <el-input
                                v-model="infoForm.profession"
                                class="topic-input-select"
                                placeholder="请输入"
                                :disabled="ifAdd"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="在校状态" prop="leaveSchool">
                            <el-input
                                v-model="infoForm.leaveSchool"
                                class="topic-input-select"
                                placeholder="请输入"
                                :disabled="ifAdd"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="24">
                    <el-col :span="6">
                        <el-form-item label="培养类别" prop="trainingCategory">
                            <el-input
                                v-model="infoForm.trainingCategory"
                                class="topic-input-select"
                                placeholder="请输入"
                                :disabled="ifAdd"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="培养层次" prop="trainingLevelName">
                            <el-input
                                v-model="infoForm.trainingLevelName"
                                class="topic-input-select"
                                :disabled="ifAdd"
                                maxlength="32"
                            ></el-input>
                        </el-form-item>
                    </el-col>

                    <el-col :span="6">
                        <el-form-item label="导师" prop="teacher">
                            <el-input
                                v-model="infoForm.teacher"
                                class="topic-input-select"
                                :disabled="ifAdd"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="是否存在不及格课程" prop="isFlunk">
                            <el-select
                                v-model="infoForm.isFlunk"
                                class="topic-input-select"
                                :disabled="ifAdd"
                            >
                                <el-option
                                    v-for="item in source.isFlunk"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="24">
                    <el-col :span="6">
                        <el-form-item label="博士论文是否开题" prop="isSelected">
                            <el-select
                                v-model="infoForm.isSelected"
                                class="topic-input-select"
                                :disabled="ifAdd"
                            >
                                <el-option
                                    v-for="item in source.isSelected"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="录取类别" prop="enrolCategory">
                            <el-input
                                v-model="infoForm.enrolCategory"
                                class="topic-input-select"
                                :disabled="ifAdd"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="手机" prop="phoneNumber">
                            <el-input
                                v-model="infoForm.phoneNumber"
                                class="topic-input-select"
                                :disabled="ifShowDetail"
                                maxlength="32"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="电子邮件" prop="email">
                            <el-tooltip
                                class="item"
                                effect="light"
                                :content="infoForm.email"
                                placement="top"
                                :disabled="showTip"
                            >
                                <el-input
                                    v-model="infoForm.email"
                                    class="topic-input-select"
                                    :disabled="ifShowDetail"
                                    maxlength="320"
                                ></el-input>
                            </el-tooltip>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="24">
                    <el-col :span="6">
                        <el-form-item label="预计毕业时间" prop="expectedGraduationDate">
                            <el-date-picker
                                v-model="infoForm.expectedGraduationDate"
                                type="date"
                                :disabled="ifAdd"
                                class="topic-input-select"
                                value-format="yyyy-MM-dd HH:mm:ss"
                            ></el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="是否申请过对外交流项目" prop="isApply">
                            <el-input
                                v-model="infoForm.isApply"
                                class="topic-input-select"
                                :disabled="ifAdd"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item
                            label="对外交流项目类别"
                            prop="projectSubject"
                            v-show="infoForm.isApply === '是'"
                        >
                            <el-tooltip
                                class="item"
                                effect="light"
                                :content="infoForm.projectSubject"
                                placement="top"
                                :disabled="showProTip"
                            >
                                <el-input
                                    v-model="infoForm.projectSubject"
                                    class="topic-input-select"
                                    :disabled="ifAdd"
                                ></el-input>
                            </el-tooltip>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>

            <!--申请国际学术会议信息  开始  -->
            <el-form
                :model="submitForm"
                ref="submitForm"
                :rules="basicInfoRules"
                label-position="top"
                label-suffix="："
                :label-width="labelWidth"
            >
                <span class="topic-form-title">
                    <h3>申请国际学术会议信息</h3>
                </span>
                <el-row :gutter="24">
                    <el-col :span="6">
                        <el-form-item label="会议申报学院" prop="faculty">
                            <el-select
                                v-model="submitForm.faculty"
                                class="topic-input-select"
                                @change="handleSubjectChange"
                                clearable
                                filterable
                                placeholder="请选择"
                                :disabled="ifShowDetail"
                            >
                                <el-option
                                    v-for="item in options.faculty"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="一级学科名称" prop="oneSubjectName">
                            <el-select
                                v-model="submitForm.oneSubjectName"
                                class="topic-input-select"
                                clearable
                                :disabled="ifShowDetail"
                                @change="getLevel"
                            >
                                <el-option
                                    v-for="item in options.oneSubjectName"
                                    :key="item.code"
                                    :label="item.name"
                                    :value="item.code"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="会议等级" prop="conferenceLevel">
                            <el-select
                                v-model="submitForm.conferenceLevel"
                                class="topic-input-select"
                                clearable
                                placeholder="请选择"
                                :disabled="ifShowDetail"
                            >
                                <el-option
                                    v-for="item in options.conferenceLevel"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="24">
                    <el-col :span="12">
                        <el-form-item label="国际会议英文名称" prop="englishName">
                            <el-tooltip
                                class="item"
                                effect="light"
                                :content="submitForm.englishName"
                                placement="top"
                                :disabled="!submitForm.englishName"
                            >
                            <el-select
                                v-model="submitForm.englishName"
                                @change="handleCollegeChange"
                                class="topic-input-select"
                                clearable
                                filterable
                                :disabled="ifShowDetail"
                            >
                                <el-option
                                    v-for="item in options.englishName"
                                    :key="item"
                                    :label="item"
                                    :value="item"
                                ></el-option>
                            </el-select>
                            </el-tooltip>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="国际会议英文名称缩写" prop="englishNameAbbreviation">
                            <el-input
                                v-model="submitForm.englishNameAbbreviation"
                                class="topic-input-select"
                                :disabled="ifAdd"
                                maxlength="32"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="24">
                    <el-col :span="12">
                        <el-form-item label="国际会议中文名称" prop="name">
                            <el-input
                                v-model="submitForm.name"
                                class="topic-input-select"
                                :disabled="ifAdd"
                                maxlength="32"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="国际会议官方网址" prop="conferenceWebsite">
                            <el-tooltip
                                class="item"
                                effect="light"
                                :content="submitForm.conferenceWebsite"
                                placement="top"
                                :disabled="!submitForm.conferenceWebsite"
                            >
                            <el-input
                                v-model="submitForm.conferenceWebsite"
                                class="topic-input-select"
                                :disabled="ifShowDetail"
                                maxlength="320"
                            ></el-input>
                            </el-tooltip>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="24">
                    <el-col :span="6">
                        <el-form-item label="国际会议开始时间" prop="conferenceStartTime">
                            <el-date-picker
                                v-model="submitForm.conferenceStartTime"
                                type="date"
                                class="topic-input-select"
                                :disabled="ifShowDetail"
                                value-format="yyyy-MM-dd HH:mm:ss"
                                :picker-options="startDatePicker"
                            ></el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="国际会议结束时间" prop="conferenceEndTime">
                            <el-date-picker
                                v-model="submitForm.conferenceEndTime"
                                type="date"
                                class="topic-input-select"
                                :disabled="ifShowDetail"
                                value-format="yyyy-MM-dd HH:mm:ss"
                                :picker-options="endDatePicker"
                            ></el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="国际会议是属于第几届" prop="session">
                            <el-input
                                v-model="submitForm.session"
                                class="topic-input-select"
                                placeholder="请输入"
                                :disabled="ifShowDetail"
                                maxlength="32"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="国际会议规模人数" prop="peopleNumber">
                            <el-input
                                v-model="submitForm.peopleNumber"
                                class="topic-input-select"
                                placeholder="请输入"
                                :disabled="ifShowDetail"
                                maxlength="32"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="24">
                    <el-col :span="12">
                        <el-form-item label="主办单位" prop="organizer">
                            <el-input
                                v-model="submitForm.organizer"
                                class="topic-input-select"
                                placeholder="请输入"
                                :disabled="ifShowDetail"
                                maxlength="32"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="主办单位国家地区" prop="countryCode">
                            <el-select
                                v-model="submitForm.countryCode"
                                class="topic-input-select"
                                clearable
                                filterable
                                placeholder="请选择"
                                :disabled="ifShowDetail"
                            >
                                <el-option
                                    v-for="item in options.country"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="24">
                    <el-col :span="12">
                        <el-form-item label="宣读/海报题目" prop="subject">
                            <el-input
                                v-model="submitForm.subject"
                                class="topic-input-select"
                                :disabled="ifShowDetail"
                                maxlength="32"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="宣读/海报" prop="type">
                            <el-select
                                v-model="submitForm.type"
                                class="topic-input-select"
                                :disabled="ifShowDetail"
                            >
                                <el-option
                                    v-for="item in options.type"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="24">
                    <el-col :span="6">
                        <el-form-item label="宣读/海报时间" prop="subjectTime">
                            <el-date-picker
                                v-model="submitForm.subjectTime"
                                type="date"
                                class="topic-input-select"
                                :disabled="ifShowDetail"
                                value-format="yyyy-MM-dd HH:mm:ss"
                            ></el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="录用文章作者" prop="author">
                            <el-select
                                v-model="submitForm.author"
                                class="topic-input-select"
                                :disabled="ifShowDetail"
                            >
                                <el-option
                                    v-for="item in options.author"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="录用文章署名单位" prop="signatureUnit">
                            <el-input
                                v-model="submitForm.signatureUnit"
                                class="topic-input-select"
                                placeholder="请输入"
                                :disabled="ifShowDetail"
                                maxlength="32"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="24">
                    <el-col :span="12">
                        <el-form-item
                            label="论文是否被录用为大会（或分会场）特邀报告或主题发言"
                            prop="employStatus"
                            label-width="430"
                        >
                            <template>
                                <el-radio
                                    :label="1"
                                    :disabled="ifShowDetail"
                                    v-model="submitForm.employStatus"
                                >是</el-radio>
                                <el-radio
                                    :label="0"
                                    :disabled="ifShowDetail"
                                    v-model="submitForm.employStatus"
                                >否</el-radio>
                            </template>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="申请人参会形式" prop="conferenceForm">
                            <el-select
                                v-model="submitForm.conferenceForm"
                                class="topic-input-select"
                                :disabled="ifShowDetail"
                            >
                                <el-option
                                    v-for="item in options.conferenceFormList"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>

                <span class="topic-form-title">
                    <h3>学生外语水平</h3>
                </span>
                <el-row :gutter="24">
                    <el-col :span="6">
                        <el-form-item label="外语成绩" prop="foreignLanguagesScore">
                            <el-input
                                v-model="submitForm.foreignLanguagesScore"
                                class="topic-input-select"
                                placeholder="请输入（例如：雅思6.6）"
                                :disabled="ifShowDetail"
                                maxlength="128"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>

                <span class="topic-form-title">
                    <h3>在校期间，曾获校内项目资助情况</h3>
                </span>
                <el-row :gutter="24">
                    <el-col :span="24">
                        <el-form-item label="在校期间曾获项目资助" prop="projectFunding">
                            <el-input
                                v-model="submitForm.projectFunding"
                                class="topic-input-select"
                                :disabled="ifShowDetail"
                                maxlength="128"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24">
                        <el-form-item label="备注" prop="remark">
                            <el-input
                                v-model="submitForm.remark"
                                class="topic-input-select"
                                type="textarea"
                                :rows="4"
                                maxlength="500"
                                show-word-limit
                                placeholder="请输入"
                                :disabled="ifShowDetail"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <!--申请国际学术会议信息  结束  -->
            <el-form ref="fileform" label-position="left" :model="fileform" :rules="fileformRules">
                <span class="topic-form-title">
                    <h3>附件管理</h3>
                </span>
                <el-divider></el-divider>
                <div class="fileStyle">
                    <el-row :gutter="24">
                        <el-col :span="9">
                            <el-form-item
                                label="会议征文通知(大会简介)"
                                class="topic-form-title"
                                label-width="150px"
                                prop="mark1"
                            >
                                <el-upload
                                    v-model="fileform.mark1"
                                    class="upload-demo"
                                    action="/api/commonservice/obsfile/uploadfile"
                                    :data="uploadConfig.data"
                                    :on-exceed="handleExceed"
                                    :before-upload="(file) =>beforeUpload(file, 1)"
                                    :on-success="(response, file, fileList) => handlerUploadSuccess(response, file, fileList, 1)"
                                    :before-remove="(file, fileList) =>handlerBeforeRemove(file, fileList, 1)"
                                    :on-remove="(file, fileList) =>handlerRemove(file, fileList, 1)"
                                    :on-error="(err, file, fileList) =>handlerUploadError(err, file, fileList, 1)"
                                    :on-preview="(file) =>downloadMaterial(file, 1)"
                                    accept="application/pdf"
                                    multiple
                                    :limit="1"
                                    :file-list="fileList1"
                                    :disabled="ifShowDetail"
                                >
                                    <el-button
                                        size="small"
                                        type="primary"
                                        v-show="!ifShowDetail"
                                    >{{ $t('graduateBase.chooseFile') }}</el-button>
                                </el-upload>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item
                                label="请上传PDF格式文件，大小不要超过5MB（仅允许一个文件）"
                                class="topic-form-title"
                                label-position="left"
                            ></el-form-item>
                        </el-col>
                    </el-row>
                    <el-divider></el-divider>
                    <el-row :gutter="24">
                        <el-col :span="9">
                            <el-form-item
                                label="正式邀请信函"
                                class="topic-form-title"
                                label-width="150px"
                                prop="mark2"
                            >
                                <el-upload
                                    v-model="fileform.mark2"
                                    class="upload-demo"
                                    action="/api/commonservice/obsfile/uploadfile"
                                    :data="uploadConfig.data"
                                    :on-exceed="handleExceed"
                                    :before-upload="(file) =>beforeUpload(file, 2)"
                                    :on-success="(response, file, fileList) => handlerUploadSuccess(response, file, fileList, 2)"
                                    :before-remove="(file, fileList) =>handlerBeforeRemove(file, fileList, 2)"
                                    :on-remove="(file, fileList) =>handlerRemove(file, fileList, 2)"
                                    :on-error="(err, file, fileList) =>handlerUploadError(err, file, fileList, 2)"
                                    :on-preview="(file) =>downloadMaterial(file, 2)"
                                    accept="application/pdf"
                                    multiple
                                    :limit="1"
                                    :file-list="fileList2"
                                    :disabled="ifShowDetail"
                                >
                                    <el-button
                                        size="small"
                                        type="primary"
                                        v-show="!ifShowDetail"
                                    >{{ $t('graduateBase.chooseFile') }}</el-button>
                                </el-upload>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item
                                label="请上传PDF格式文件，大小不要超过5MB（仅允许一个文件）"
                                class="topic-form-title"
                                label-position="left"
                            ></el-form-item>
                        </el-col>
                    </el-row>
                    <el-divider></el-divider>
                    <el-row :gutter="24">
                        <el-col :span="9">
                            <el-form-item
                                label="论文录用情况证明"
                                class="topic-form-title"
                                label-width="150px"
                                prop="mark3"
                            >
                                <el-upload
                                    v-model="fileform.mark3"
                                    class="upload-demo"
                                    action="/api/commonservice/obsfile/uploadfile"
                                    :data="uploadConfig.data"
                                    :on-exceed="handleExceed"
                                    :before-upload="(file) =>beforeUpload(file, 3)"
                                    :on-success="(response, file, fileList) => handlerUploadSuccess(response, file, fileList, 3)"
                                    :before-remove="(file, fileList) =>handlerBeforeRemove(file, fileList, 3)"
                                    :on-remove="(file, fileList) =>handlerRemove(file, fileList, 3)"
                                    :on-error="(err, file, fileList) =>handlerUploadError(err, file, fileList, 3)"
                                    :on-preview="(file) =>downloadMaterial(file, 3)"
                                    accept="application/pdf"
                                    multiple
                                    :limit="1"
                                    :file-list="fileList3"
                                    :disabled="ifShowDetail"
                                >
                                    <el-button
                                        size="small"
                                        type="primary"
                                        v-show="!ifShowDetail"
                                    >{{ $t('graduateBase.chooseFile') }}</el-button>
                                </el-upload>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item
                                label="请上传PDF格式文件，大小不要超过5MB（仅允许一个文件，需明确注明被安排为口头/展板报告，而非摘要接收函）"
                                class="topic-form-title"
                                label-position="left"
                            ></el-form-item>
                        </el-col>
                    </el-row>
                    <el-divider></el-divider>
                    <el-row :gutter="24">
                        <el-col :span="9">
                            <el-form-item
                                label="申请者宣读论文或张贴海报的时间安排表、会议网址等信息"
                                class="topic-form-title"
                                label-width="150px"
                                prop="mark4"
                            >
                                <el-upload
                                    v-model="fileform.mark4"
                                    class="upload-demo"
                                    action="/api/commonservice/obsfile/uploadfile"
                                    :data="uploadConfig.data"
                                    :on-exceed="handleExceed"
                                    :before-upload="(file) =>beforeUpload(file, 4)"
                                    :on-success="(response, file, fileList) => handlerUploadSuccess(response, file, fileList, 4)"
                                    :before-remove="(file, fileList) =>handlerBeforeRemove(file, fileList, 4)"
                                    :on-remove="(file, fileList) =>handlerRemove(file, fileList, 4)"
                                    :on-error="(err, file, fileList) =>handlerUploadError(err, file, fileList, 4)"
                                    :on-preview="(file) =>downloadMaterial(file, 4)"
                                    accept="application/pdf"
                                    multiple
                                    :limit="1"
                                    :file-list="fileList4"
                                    :disabled="ifShowDetail"
                                >
                                    <el-button
                                        size="small"
                                        type="primary"
                                        v-show="!ifShowDetail"
                                    >{{ $t('graduateBase.chooseFile') }}</el-button>
                                </el-upload>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item
                                label="请上传PDF格式文件，大小不要超过5MB（仅允许一个文件）"
                                class="topic-form-title"
                                label-position="left"
                            ></el-form-item>
                        </el-col>
                    </el-row>
                    <el-divider></el-divider>
                    <el-row :gutter="24">
                        <el-col :span="9">
                            <el-form-item
                                label="会议论文全文或摘要"
                                class="topic-form-title"
                                label-width="150px"
                                prop="mark5"
                            >
                                <el-upload
                                    v-model="fileform.mark5"
                                    class="upload-demo"
                                    action="/api/commonservice/obsfile/uploadfile"
                                    :data="uploadConfig.data"
                                    :before-upload="(file) =>beforeUpload(file, 5)"
                                    :on-exceed="handleExceed"
                                    :on-success="(response, file, fileList) => handlerUploadSuccess(response, file, fileList, 5)"
                                    :before-remove="(file, fileList) =>handlerBeforeRemove(file, fileList, 5)"
                                    :on-remove="(file, fileList) =>handlerRemove(file, fileList, 5)"
                                    :on-error="(err, file, fileList) =>handlerUploadError(err, file, fileList, 5)"
                                    :on-preview="(file) =>downloadMaterial(file, 5)"
                                    accept="application/pdf"
                                    multiple
                                    :limit="1"
                                    :file-list="fileList5"
                                    :disabled="ifShowDetail"
                                >
                                    <el-button
                                        size="small"
                                        type="primary"
                                        v-show="!ifShowDetail"
                                    >{{ $t('graduateBase.chooseFile') }}</el-button>
                                </el-upload>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item
                                label="请上传PDF格式文件，大小不要超过5MB
                            （仅允许一个文件，需含有作者排名和单位信息，论文需本人为第一作者且第一署名单位为同济大学，
                            或其导师为第一作者，本人为第二作者，且第一、第二作者署名单位均为同济大学）"
                                class="topic-form-title"
                                label-position="left"
                            ></el-form-item>
                        </el-col>
                    </el-row>
                    <el-divider></el-divider>
                    <el-row :gutter="24">
                        <el-col :span="9">
                            <el-form-item
                                label="外语水平证明复印件"
                                class="topic-form-title"
                                label-width="150px"
                                prop="mark6"
                            >
                                <el-upload
                                    v-model="fileform.mark6"
                                    class="upload-demo"
                                    action="/api/commonservice/obsfile/uploadfile"
                                    :data="uploadConfig.data"
                                    :before-upload="(file) =>beforeUpload(file, 6)"
                                    :on-exceed="handleExceed"
                                    :on-success="(response, file, fileList) => handlerUploadSuccess(response, file, fileList, 6)"
                                    :before-remove="(file, fileList) =>handlerBeforeRemove(file, fileList, 6)"
                                    :on-remove="(file, fileList) =>handlerRemove(file, fileList, 6)"
                                    :on-error="(err, file, fileList) =>handlerUploadError(err, file, fileList, 6)"
                                    :on-preview="(file) =>downloadMaterial(file, 6)"
                                    accept="application/pdf"
                                    multiple
                                    :limit="1"
                                    :file-list="fileList6"
                                    :disabled="ifShowDetail"
                                >
                                    <el-button
                                        size="small"
                                        type="primary"
                                        v-show="!ifShowDetail"
                                    >{{ $t('graduateBase.chooseFile') }}</el-button>
                                </el-upload>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item
                                label="请上传PDF格式文件，大小不要超过5MB（仅允许一个文件）"
                                class="topic-form-title"
                                label-position="left"
                            ></el-form-item>
                        </el-col>
                    </el-row>
                    <el-divider></el-divider>
                    <el-row :gutter="24">
                        <el-col :span="9">
                            <el-form-item
                                label="同济大学出国任务批件复印件"
                                class="topic-form-title"
                                label-width="150px"
                                prop="mark7"
                            >
                                <el-upload
                                    v-model="fileform.mark7"
                                    class="upload-demo"
                                    action="/api/commonservice/obsfile/uploadfile"
                                    :data="uploadConfig.data"
                                    :before-upload="(file) =>beforeUpload(file, 7)"
                                    :on-exceed="handleExceed"
                                    :on-success="(response, file, fileList) => handlerUploadSuccess(response, file, fileList, 7)"
                                    :before-remove="(file, fileList) =>handlerBeforeRemove(file, fileList, 7)"
                                    :on-remove="(file, fileList) =>handlerRemove(file, fileList, 7)"
                                    :on-error="(err, file, fileList) =>handlerUploadError(err, file, fileList, 7)"
                                    :on-preview="(file) =>downloadMaterial(file, 7)"
                                    accept="application/pdf"
                                    multiple
                                    :limit="1"
                                    :file-list="fileList7"
                                    :disabled="ifShowDetail"
                                >
                                    <el-button
                                        size="small"
                                        type="primary"
                                        v-show="!ifShowDetail"
                                    >{{ $t('graduateBase.chooseFile') }}</el-button>
                                </el-upload>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <!-- <el-form-item
                            label="请上传PDF格式文件，大小不要超过5MB（仅允许一个文件）(已参加过会议的必须提供）"
                            class="topic-form-title"
                            label-position="left"
                            ></el-form-item>-->
                            <div class="topic-form-notice">
                                <span>请上传PDF格式文件，大小不要超过5MB（仅允许一个文件）</span>
                                <span style="color:red">(已参加过会议的必须提供)</span>
                            </div>
                        </el-col>
                    </el-row>
                </div>
                <el-divider></el-divider>
            </el-form>
            <span class="topic-form-title">
                <h3>出国/境及经费历史信息</h3>
            </span>
            <el-table :data="pgExchangeHistory">
                <el-table-column prop="destinationCountry" label="出国/境目的地"></el-table-column>
                <el-table-column prop="inviteAgency" label="邀请单位名称"></el-table-column>
                <el-table-column prop="planStartTime" label="预计出国时间"></el-table-column>
                <el-table-column prop="planEndTime" label="预计回国时间"></el-table-column>
                <el-table-column prop="realEndTime" label="实际回国时间"></el-table-column>
                <el-table-column prop="backStatus" label="回国登记状态"></el-table-column>
                <el-table-column prop="grantingAgency" label="出资单位名称"></el-table-column>
                <el-table-column prop label="审核状态"></el-table-column>
            </el-table>
            <div>
                <hr />
                <div class="edu-opertion-bar">
                    <div class="float-right" v-show="!ifShowDetail">
                        <el-button @click="onCancel">取消</el-button>
                        <el-button type="primary" @click="onSubmit(0)">保存</el-button>
                        <el-button type="primary" @click="onSubmit(1)">提交</el-button>
                    </div>
                </div>
            </div>
        </el-card>
        <el-card v-show="ifShowDetail">
            <span class="topic-form-title">
                <h3>审批进度</h3>
            </span>
            <edu-table :pagination="false" :data="approveHistory" :selection="false">
                <edu-table-column prop="time" label="时间" align="center">
                    <template slot-scope="scope">{{scope.row.time | time}}</template>
                </edu-table-column>
                <edu-table-column prop="role" label="角色" align="center"></edu-table-column>
                <edu-table-column prop="approvorName" label="审批人" align="center"></edu-table-column>
                <edu-table-column prop="result" label="审批结果" align="center">
                    <template slot-scope="scope">{{scope.row.result | result}}</template>
                </edu-table-column>
                <edu-table-column prop="content" label="审批说明" align="center"></edu-table-column>
            </edu-table>
        </el-card>
    </div>
</template>
<script>
import filters from 'common/src/filters'
import { queryDic } from 'common/src/api/dictionary'
import { downloadfile } from 'common/src/api/upload'
import UTILS from 'common/src/utils/utils'
import conOfIntAcaConApi from 'common/src/api/internationalCommunication/conOfIntAcaCon'
import appListOfIntAcaConApi from 'common/src/api/internationalCommunication/appListOfIntAcaCon'
import * as INDEX from 'common/src/utils/index'

export default {
    name: '',
    props: {
        studentInfo: {
            type: Object,
            default: {}
        },
        pgConferenceApply: {
            type: Object,
            default: {}
        },

        file: {
            type: Array,
            default: []
        },
        approveHistory: {
            type: Array,
            default: []
        },
        pgExchangeHistory: {
            type: Array,
            default: []
        },
        ifShowDetail: {
            type: Boolean,
            default: false
        },
        ifAdd: {
            type: Boolean,
            default: true
        },
        submitType: {
            type: String,
            default: ''
        },
        countryList: {
            type: Array,
            default: []
        }
    },

    data() {
        return {
            directoryId: '',
            startDatePicker: this.beginDate(),
            endDatePicker: this.processDate(),
            fileList1: [],
            fileList2: [],
            fileList3: [],
            fileList4: [],
            fileList5: [],
            fileList6: [],
            fileList7: [],
            pgExchangeHistory: [],
            showTip: true,
            showProTip: true,
            source: {
                sex: [
                    {
                        value: 1,
                        label: '男'
                    },
                    {
                        value: 2,
                        label: '女'
                    }
                ],
                isSelected: [
                    {
                        value: 0,
                        label: '否'
                    },
                    {
                        value: 1,
                        label: '是'
                    }
                ],
                isFlunk: [
                    {
                        value: 0,
                        label: '否'
                    },
                    {
                        value: 1,
                        label: '是'
                    }
                ],
                formLearning: []
            },
            showEnglishName: false,
            infoForm: {
                email: '',
                studentId: '',
                phoneNumber: ''
            },
            fileform: {
                mark1: '',
                mark2: '',
                mark3: '',
                mark4: '',
                mark5: '',
                mark6: '',
                mark7: ''
            },
            submitForm: {
                studentId: '',
                phoneNumber: '',
                email: '',
                applyTime: '',
                faculty: '',
                oneSubjectName: '',
                englishName: '',
                conferenceStartTime: '',
                conferenceEndTime: '',
                conferenceWebsite: '',
                facultyCnName: '',
                oneSubjectCnName: '',
                conferenceLevel: '',
                name: '',
                englishNameAbbreviation: '',
                session: '',
                organizer: '',
                countryCode: '',
                peopleNumber: '',
                type: '',
                subject: '',
                subjectTime: '',
                author: '',
                signatureUnit: '',
                employStatus: 0,
                conferenceForm: '',
                foreignLanguagesScore: '',
                projectFunding: '',
                remark: ''
            },
            submitParms: {
                fileList: []
            },
            tableData: [],
            options: {
                conferenceLevel: [],
                faculty: [],
                oneSubjectName: [],
                englishName: [],
                country: [],
                type: [
                    {
                        value: 1,
                        label: '宣读'
                    },
                    {
                        value: 2,
                        label: '海报'
                    }
                ],
                author: [
                    {
                        value: 1,
                        label: '本人第一'
                    },
                    {
                        value: 2,
                        label: '导师第一本人第二'
                    },
                    {
                        value: 3,
                        label: '其它'
                    }
                ],
                conferenceFormList: [
                    {
                        value: '线上参会',
                        label: '线上参会'
                    },
                    {
                        value: '线下参会',
                        label: '线下参会'
                    }
                ]
            },
            basicInfoRules: {
                phoneNumber: [
                    { required: true, message: '请输入', trigger: 'blur' },
                    { validator: this.checkPhone, trigger: 'blur' }
                ], //电话号码
                email: [
                    { required: true, message: '请输入', trigger: 'blur' },
                    { validator: this.checkEmail, trigger: 'blur' }
                ], // 邮箱
                faculty: [{ required: true, message: '请选择', trigger: 'change' }], // 申报学院
                oneSubjectName: [{ required: true, message: '请选择', trigger: 'change' }], // 一级学科名称
                conferenceLevel: [{ required: true, message: '请选择', trigger: 'change' }], //会议等级
                conferenceWebsite: [{ required: true, message: '请输入', trigger: 'blur' }], //网址
                conferenceStartTime: [{ required: true, message: '请选择', trigger: 'change' }], //会议开始时间
                conferenceEndTime: [{ required: true, message: '请选择', trigger: 'change' }], // 会议结束时间
                session: [{ required: true, message: '请输入', trigger: 'blur' }], // 届数
                englishName: [{ required: true, message: '请选择', trigger: 'change' }], // 国际会议英文名称
                peopleNumber: [{ required: true, message: '请输入', trigger: 'blur' }], // 规模人数
                organizer: [{ required: true, message: '请输入', trigger: 'blur' }], // 主办单位
                countryCode: [{ required: true, message: '请选择', trigger: 'change' }], // 举办国家
                subject: [{ required: true, message: '请输入', trigger: 'blur' }], // 宣读/海报题目
                type: [{ required: true, message: '请选择', trigger: 'change' }], // 宣读/海报
                author: [{ required: true, message: '请选择', trigger: 'change' }], // 录文章作者
                employStatus: [{ required: true, message: '请选择', trigger: 'change' }], // 是否被录用
                conferenceForm: [{ required: true, message: '请选择', trigger: 'change' }], // 申请人参会形式
                signatureUnit: [{ required: true, message: '请输入', trigger: 'blur' }], // 署名单位
                foreignLanguagesScore: [
                    { required: true, message: '请输入（例如：雅思 6.5）', trigger: 'change' }
                ] // 外语成绩
            },
            fileformRules: {
                mark1: [{ required: true, message: '请上传附件', trigger: 'change' }],
                mark2: [{ required: true, message: '请上传附件', trigger: 'change' }],
                mark3: [{ required: true, message: '请上传附件', trigger: 'change' }],
                mark5: [{ required: true, message: '请上传附件', trigger: 'change' }],
                mark6: [{ required: true, message: '请上传附件', trigger: 'change' }]
            },
            submitFileList: [],
            compareNameList: [],

            uploadConfig: {
                data: { bucketname: 'face', folderpath: 'file' }
            }
        }
    },
    filters: {
        time(val) {
            return INDEX.parseTime(val, '{y}-{m}-{d}')
        },
        result(val) {
            switch (val) {
                case 'Process':
                    return '通过'
                case 'Reject':
                    return '驳回'
                case 'Recall':
                    return '撤回'
                case 'End':
                    return '通过'
                case 'COMMIT':
                    return '已提交'
                case 'approveNoPass':
                    return '不通过'
                default:
                    return ' '
            }
        }
    },
    created() {
        this.submitForm = {
            studentId: '',
            phoneNumber: '',
            email: '',
            applyTime: '',
            faculty: '',
            oneSubjectName: '',
            englishName: '',
            conferenceStartTime: '',
            conferenceEndTime: '',
            conferenceWebsite: '',
            facultyCnName: '',
            oneSubjectCnName: '',
            conferenceLevel: '',
            name: '',
            englishNameAbbreviation: '',
            session: '',
            organizer: '',
            countryCode: '',
            peopleNumber: '',
            type: '',
            subject: '',
            subjectTime: '',
            author: '',
            signatureUnit: '',
            employStatus: 0,
            conferenceForm: '',
            foreignLanguagesScore: '',
            projectFunding: '',
            remark: ''
        }
        if (this.submitType !== 'view') {
            this.initOptions()
        }

        // 新增的时候获取历史经费信息
        if (this.submitType === 'add') {
            appListOfIntAcaConApi.queryHistories().then(resT => {
                this.pgExchangeHistory = resT.data.pgExchangeHistory
            })
        }
    },
    mounted() {
        if (this.submitType === 'add') {
            this.fileList1 = []
            this.fileList2 = []
            this.fileList3 = []
            this.fileList4 = []
            this.fileList5 = []
            this.fileList6 = []
            this.fileList7 = []
            this.submitFileList = []
            Object.keys(this.submitForm).map(value => {
                this.submitForm[value] = ''
            })
            this.submitForm.employStatus = 0

            // this.submitForm = {}
        }
        // this.getLevel()
        this.$refs['submitForm'].clearValidate()
    },
    computed: {
        getEnglishName() {
            const { faculty, oneSubjectName, conferenceLevel, englishName } = this.submitForm
            return {
                faculty,
                oneSubjectName,
                conferenceLevel,
                englishName
            }
        }
    },

    watch: {
        countryList: {
            handler(newVal) {
                let _this = this
                if (newVal && newVal.country) {
                    newVal.country.forEach(val => {
                        _this.options.country.push(val)
                    })
                }
            },
            deep: true,
            immediate: true
        },

        getEnglishName(val) {
            if (this.submitType !== 'view') {
                if (val.faculty && val.oneSubjectName && val.conferenceLevel) {
                    let parm = {
                        faculty: val.faculty,
                        oneSubjectName: val.oneSubjectName,
                        conferenceLevel: val.conferenceLevel,
                        englishName: this.submitForm.englishName
                    }
                    this.getEnglishList(parm)
                }
                if (
                    val.faculty &&
                    val.oneSubjectName &&
                    val.conferenceLevel &&
                    this.submitForm.englishName
                ) {
                    let parm = {
                        faculty: val.faculty,
                        oneSubjectName: val.oneSubjectName,
                        conferenceLevel: val.conferenceLevel,
                        englishName: this.submitForm.englishName
                    }
                    this.getMeetingInfo(parm)
                } else {
                    this.submitForm.name = ''
                    this.submitForm.englishNameAbbreviation = ''
                }
            }
        },
        pgConferenceApply: {
            handler(newVal) {
                if (newVal && this.submitType !== 'add') {
                    let currentInfo = JSON.parse(JSON.stringify(newVal))
                    for (let key in currentInfo) {
                        this.submitForm[key] = currentInfo[key]
                    }
                    if (this.submitType === 'view') {
                        this.submitForm.countryCode = this.submitForm.countryCode.toString()
                        this.submitForm.oneSubjectName = currentInfo.oneSubjectCnName
                        this.submitForm.faculty = currentInfo.facultyCnName
                        this.submitForm.englishName = currentInfo.englishName
                        this.submitForm.name = currentInfo.name
                        this.submitForm.englishNameAbbreviation =
                            currentInfo.englishNameAbbreviation
                        if (currentInfo.conferenceLevel === 1) {
                            this.submitForm.conferenceLevel = '顶级会议'
                        } else if (currentInfo.conferenceLevel === 2) {
                            this.submitForm.conferenceLevel = 'A类会议'
                        } else if (currentInfo.conferenceLevel === 3) {
                            this.submitForm.conferenceLevel = 'B类会议'
                        }
                    } else {
                        this.$nextTick(() => {
                            this.getSubject(currentInfo.faculty)
                        })
                        this.$nextTick(() => {
                            this.submitForm.oneSubjectName = currentInfo.oneSubjectName
                            this.submitForm.countryCode = this.submitForm.countryCode.toString()
                            this.getLevel('', {
                                oneSubjectName: currentInfo.oneSubjectName,
                                faculty: currentInfo.faculty
                            })
                            this.submitForm.conferenceLevel = currentInfo.conferenceLevel
                        })
                    }
                }
            },
            deep: true,
            immediate: true
        },
        studentInfo: {
            handler(newVal) {
                if (newVal) {
                    for (let key in newVal) {
                        this.infoForm[key] = newVal[key]
                    }
                }
            },
            deep: true,
            immediate: true
        },
        file: {
            handler(newVal) {
                let _this = this
                this.submitFileList = []
                this.fileList7 = []
                this.fileList4 = []
                if (newVal) {
                    newVal.forEach(val => {
                        _this.submitFileList.push(val)

                        switch (val.number) {
                            case 1:
                                _this.fileList1 = []
                                _this.fileList1.push({ name: val.fileName, fileId: val.fileId })
                                _this.$set(_this.fileform, 'mark1', 1)
                                break
                            case 2:
                                _this.fileList2 = []
                                _this.fileList2.push({ name: val.fileName, fileId: val.fileId })
                                _this.$set(_this.fileform, 'mark2', 2)
                                break
                            case 3:
                                _this.fileList3 = []
                                _this.fileList3.push({ name: val.fileName, fileId: val.fileId })
                                _this.$set(_this.fileform, 'mark3', 3)
                                break
                            case 4:
                                _this.fileList4 = []
                                _this.fileList4.push({ name: val.fileName, fileId: val.fileId })
                                _this.$set(_this.fileform, 'mark4', 4)
                                break
                            case 5:
                                _this.fileList5 = []
                                _this.fileList5.push({ name: val.fileName, fileId: val.fileId })
                                _this.$set(_this.fileform, 'mark5', 5)
                                break
                            case 6:
                                _this.fileList6 = []
                                _this.fileList6.push({ name: val.fileName, fileId: val.fileId })
                                _this.$set(_this.fileform, 'mark6', 6)
                                break
                            case 7:
                                _this.fileList7 = []
                                _this.fileList7.push({ name: val.fileName, fileId: val.fileId })
                                _this.$set(_this.fileform, 'mark7', 7)
                                break
                        }
                    })
                }
            },
            deep: true,
            immediate: true
        },
        'infoForm.email': {
            handler(newVal) {
                if (newVal &&  newVal.length > 20) {
                    this.showTip = false
                } else {
                    this.showTip = true
                }
            },
            deep: true,
            immediate: true
        },
        'infoForm.projectSubject': {
            handler(newVal) {
                if (newVal &&  newVal.length > 20) {
                    this.showProTip = false
                } else {
                    this.showProTip = true
                }
            },
            deep: true,
            immediate: true
        }
    },

    methods: {
        // 校验手机号码
        checkPhone(rule, value, callback) {
            let regExp = /^1[23456789]\d{9}$/
            if (!regExp.test(value)) {
                callback(new Error(this.$t('projectApplication.validateStudentPhone')))
            } else {
                callback()
            }
        },
        // 校验电子邮件地址
        checkEmail(rule, value, callback) {
            let regExp = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
            if (!regExp.test(value)) {
                callback(new Error(this.$t('projectApplication.validateStudentEmail')))
            } else {
                callback()
            }
        },
        // async initOptions() {
        //     // 筛选条件字典查询
        //     let data = {
        //         lang: this.$store.getters.language || 'cn',
        //         type: 'allChild',
        //         keys: [
        //             'X_YX' // 学院
        //         ]
        //     }
        //     await queryDic(data).then(res => {
        //         UTILS.fillSelect(
        //             {
        //                 faculty: 'X_YX' // 学院
        //             },
        //             res.data,
        //             this.options
        //         )
        //     })
        // },

        // 学院改变时候 改变一级学科
        handleSubjectChange(val) {
            if (this.submitType !== 'view') {
                this.getSubject(val)
            }
        },

        // 获取会议级别
        getLevel(val, newVal) {
            if (this.submitType !== 'view') {
                this.submitForm.conferenceLevel = ''
                this.options.conferenceLevel = []
                let parm = {}
                if (newVal) {
                    parm = newVal
                } else {
                    parm = {
                        faculty: this.submitForm.faculty,
                        oneSubjectName: this.submitForm.oneSubjectName
                    }
                }
                appListOfIntAcaConApi.getLevel(parm).then(res => {
                    if (res.code === 200) {
                        res.data.forEach(level => {
                            switch (level) {
                                case 1:
                                    this.options.conferenceLevel.push({
                                        label: '顶级会议',
                                        value: 1
                                    })
                                    break
                                case 2:
                                    this.options.conferenceLevel.push({
                                        label: 'A类会议',
                                        value: 2
                                    })
                                    break
                                case 3:
                                    this.options.conferenceLevel.push({
                                        label: 'B类会议',
                                        value: 3
                                    })
                                    break
                            }
                        })
                    }
                })
            }
        },

        initOptions() {
            appListOfIntAcaConApi.getDirectoryFaculty().then(res => {
                if (res.code === 200) {
                    res.data.forEach(val => {
                        this.options.faculty.push({
                            label: val.facultyName,
                            value: val.faculty
                        })
                    })
                }
            })
        },

        beginDate() {
            let _this = this
            return {
                disabledDate(time) {
                    if (_this.submitForm.conferenceEndTime) {
                        //如果结束时间不为空，则小于结束时间
                        return (
                            new Date(_this.submitForm.conferenceEndTime).getTime() < time.getTime()
                        )
                    } else {
                        // return time.getTime() > Date.now()//开始时间不选时，结束时间最大值小于等于当天
                    }
                }
            }
        },
        processDate() {
            let _this = this
            return {
                disabledDate(time) {
                    if (_this.submitForm.conferenceStartTime) {
                        //如果开始时间不为空，则结束时间大于开始时间
                        return (
                            new Date(_this.submitForm.conferenceStartTime).getTime() >
                            time.getTime()
                        )
                    } else {
                        // return time.getTime() > Date.now()//开始时间不选时，结束时间最大值小于等于当天
                    }
                }
            }
        },
        // 根据学院获取一级学科名称
        getSubject(val) {
            let _this = this
            _this.submitForm.oneSubjectName = ''
            _this.options.oneSubjectName = []
            if (val) {
                let searchParm = {
                    faculty: val,
                    oneSubjectName: ''
                }
                conOfIntAcaConApi.getOneSubject(searchParm).then(res => {
                    if (res.data) {
                        res.data.forEach(subjectList => {
                            _this.options.oneSubjectName.push(subjectList)
                        })
                    }
                })
            }
        },

        // 获取英文名称
        getEnglishList(parm) {
            this.options.englishName = []
            appListOfIntAcaConApi
                .getEnglishName(parm)
                .then(res => {
                    if (res.code === 200) {
                        res.data.forEach(englishName => {
                            this.options.englishName.push(englishName)
                        })
                    }
                })
                .catch(err => {
                    this.submitForm.faculty = ''
                    this.submitForm.conferenceLevel = ''
                    this.submitForm.englishName = ''
                    this.submitForm.oneSubjectName = ''
                })
        },
        // 获取会议信息
        getMeetingInfo(parm) {
            appListOfIntAcaConApi.getConferenceByParam(parm).then(res => {
                if (res.code === 200) {
                    this.submitForm.englishNameAbbreviation = res.data.englishNameAbbreviation
                    this.submitForm.name = res.data.name
                    if (this.submitType === 'add') {
                        this.submitForm.conferenceWebsite = res.data.conferenceWebsite
                    }

                    this.directoryId = res.data.id
                }
            })
        },

        // 返回列表页
        returnList() {
            if (this.submitType === 'view') {
                this.$emit('returnVal', 1)
            } else {
                this.$confirm('取消将不会保存当前设置，是否确定?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    this.$emit('returnVal', 1)
                })
            }
        },
        // 保存
        onSave() {},

        // 提交按钮
        onSubmit(status) {
            let _this = this
            _this.$refs.infoForm.validate(valid => {
                _this.$refs.submitForm.validate(validSubmit => {
                    _this.$refs.fileform.validate(validFile => {
                        if (valid && validSubmit && validFile) {
                            this.dealWithData(status)
                            this.submit(status)
                        }
                    })
                })
            })
        },

        // 拼装提交的数据
        dealWithData(status) {
            let _this = this
            _this.submitParms = {
                fileList: []
            }
            for (let key in _this.infoForm) {
                _this.submitParms[key] = _this.infoForm[key]
            }
            _this.submitForm.email = _this.infoForm.email
            _this.submitForm.phoneNumber = _this.infoForm.phoneNumber
            _this.submitForm.studentId = _this.infoForm.studentId
            for (let key in _this.submitForm) {
                _this.submitParms[key] = _this.submitForm[key]
            }
            _this.submitFileList.forEach(val => {
                _this.submitParms.fileList.push(val)
            })
            // 保存是 0   提交是 1
            _this.submitParms.approveStatus = status
            _this.submitParms.directoryId = _this.directoryId
        },

        // 提交数据
        submit(status) {
            let _this = this
            if (_this.submitType === 'add') {
                appListOfIntAcaConApi.addApply(_this.submitParms).then(res => {
                    if (res.code === 200) {
                        if (status === 0) {
                            _this.$message({
                                message: '保存成功',
                                type: 'success'
                            })
                        } else if (status === 1) {
                            _this.$message({
                                message: '提交成功',
                                type: 'success'
                            })
                        }

                        _this.$emit('returnVal', 1)
                    }
                })
            } else if (_this.submitType === 'edit') {
                appListOfIntAcaConApi.editApply(_this.submitParms).then(res => {
                    if (res.code === 200) {
                        if (status === 0) {
                            _this.$message({
                                message: '保存成功',
                                type: 'success'
                            })
                        } else if (status === 1) {
                            _this.$message({
                                message: '提交成功',
                                type: 'success'
                            })
                        }
                        _this.$emit('returnVal', 1)
                    }
                })
            }
        },

        // 取消
        onCancel() {
            this.$confirm('取消将不会保存当前设置，是否确定?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                this.$emit('returnVal', 1)
            })
        },
        handleExceed(files, fileList) {
            this.$message.error('当前限制只能上传一个文件')
        },
        handlerBeforeRemove(file, fileList) {
            // if (this.fileFlag) {
            //     return this.$delConfirm().then(_ => {})
            // }
        },
        handlerRemove(file, fileList, value) {
            this.submitFileList.forEach((val, index) => {
                if (value === val.number) {
                    this.submitFileList.splice(index, 1)
                }
            })
            this.compareNameList.forEach((val, index) => {
                if (value === val.number) {
                    this.compareNameList.splice(index, 1)
                }
            })
            this.fileform['mark' + value] = ''
        },
        beforeUpload(file, mark) {
            const fileSizeFlag = file.size && file.size / 1024 / 1024 < 5
            let fileType = file.name.substring(file.name.lastIndexOf('.') + 1)
            const uploadFlag = fileType === 'pdf'
            let fileNameLen = file.name.length < 64
            let compFileName = true
            this.compareNameList.forEach(val => {
                if (val.fileName === file.name) {
                    compFileName = false
                }
            })
            if (!compFileName) {
                window.vueApp.showMsgBox({
                    message: '已上传相同名称的文件，请修改文件名称后重新上传',
                    callback: () => {}
                })
            }
            if (!uploadFlag) {
                window.vueApp.showMsgBox({
                    message: this.$t('minor.approve.uploadFileError'),
                    callback: () => {}
                })
            }
            if (!fileSizeFlag) {
                window.vueApp.showMsgBox({
                    message: '上传文件大小不能超过5M',
                    callback: () => {}
                })
            }
            if (!fileNameLen) {
                window.vueApp.showMsgBox({
                    message: '上传附件名称超长',
                    callback: () => {}
                })
            }
            this.fileFlag = uploadFlag && fileSizeFlag && fileNameLen && compFileName
            if (!(uploadFlag && fileSizeFlag && fileNameLen && compFileName)) {
                return false
            } else {
                this.compareNameList.push({
                    fileName: file.name,
                    number: mark
                })
            }
        },
        handlerUploadSuccess(response, file, fileList, mark) {
            let responseCode = response.code
            if (responseCode === 200) {
                let parm = {
                    number: mark,
                    fileId: Object.values(response.data)[0].objectkey,
                    fileName: Object.values(response.data)[0].fileName
                }
                this.submitFileList.push(parm)
                let test = 'mark' + mark
                this.$set(this.fileform, test, mark)

                let fileds = ''
                switch (mark) {
                    case 1:
                        fileds = 'mark1'
                        break
                    case 2:
                        fileds = 'mark2'
                        break
                    case 3:
                        fileds = 'mark3'
                        break
                    case 5:
                        fileds = 'mark5'
                        break
                    case 6:
                        fileds = 'mark6'
                        break
                }
                this.$refs['fileform'].clearValidate(fileds)
            }
        },
        handlerUploadError(response, file, fileList, value) {
            this.$message({
                message: this.$t('graduateBase.uploadFail'),
                type: 'error'
            })
            this.compareNameList.forEach((val, index) => {
                if (value === val.number) {
                    this.compareNameList.splice(index, 1)
                }
            })
        },
        downloadMaterial(file, val) {
            if (this.submitFileList) {
                this.submitFileList.forEach(fileT => {
                    if (fileT.number === val) {
                        downloadfile(fileT.fileId)
                    }
                })
            } else if (file.status === 'success' && file.response && file.response.data) {
                downloadfile(file.response.data[file.name].objectkey)
            }
        }
    }
}
</script>
<style lang="scss" scoped>
.project-application-container {
    .el-breadcrumb__item:last-child ::v-deep {
        .el-breadcrumb__inner {
            color: #606266;
            font-weight: bold;
            cursor: default;
        }
    }
    .el-breadcrumb__item ::v-deep {
        .is-link {
            color: #aaa;
            font-weight: unset;
        }
        .is-link:hover {
            color: #409eff;
        }
    }
}
.topic-info {
    .topic-title {
        color: #2b3b4e;
        font-size: 18px;
        line-height: 24px;
        font-weight: bold;
    }
    .item {
        margin: 0px;
    }
    .topic-expand {
        color: #3a7fe8;
        font-size: 14px;
        cursor: pointer;
        margin-left: 12px;
    }
    .topic-input-select {
        width: 100%;
    }
    .topic-form-title {
        font-weight: bold;
        text-align: left;
        line-height: 60px;
    }
    .topic-form-notice {
        text-align: left;
        line-height: 60px;
        color: #4c5c70;
    }
    .top-title {
        font-weight: bold;
        text-align: left;
        line-height: 30px;
    }
    .bottom-btn {
        margin-bottom: 12px;
    }
    .upload-demo {
        text-align: center;
    }
    ::v-deep.fileStyle .el-form-item--small .el-form-item__error {
        padding-top: 5px;
        margin-left: 37.5%;
    }
}
</style>